#include <iostream>

using namespace std;

int main()
{
    string s, s1 = "";
    int k;
    getline(cin, s);
    
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == '(')
        {
            s1 = s1 + s[i];
        }
        else if (s[i] == ')' and s1.size() > 0 and s1[s1.size() - 1] == '(')
        {
            s1 = s1.substr(0, s1.size()-1);
        }
        else
        {
            k = k + 1;
        }
        std::cout << s1 << std::endl;
    }
    if (s1 == "" and k == 0)
    {
        std::cout << "YES" << std::endl;
    }
    else
    {
        std::cout << "NO"<< std::endl;
    }
}